﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Categories.aspx.cs" Inherits="_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Categories</title>

    <script language="JavaScript" src="js/CalendarPopup.js"></script>

    <script language="JavaScript">
        var cal = new CalendarPopup();
    </script>

    <style type="text/css">
        .style1
        {
            width: 355px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table>
        <tr>
            <td>
                Category ID:
            </td>
            <td class="style1">
                <asp:TextBox ID="txtCategoryID" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td width="30%">
                Category Name:
            </td>
            <td class="style1">
                <asp:TextBox ID="txtCategoryName" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfCategoryName" runat="server" ControlToValidate="txtCategoryName"
                    ErrorMessage="Please enter name!" Display="Dynamic" ValidationGroup="Validate"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                Description:
            </td>
            <td class="style1">
                <asp:TextBox ID="txtDescription" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfDescription" runat="server" ErrorMessage="Please enter description!"
                    Display="Dynamic" ValidationGroup="Validate" ControlToValidate="txtDescription"></asp:RequiredFieldValidator>
            </td>
        </tr>
    </table>
    <div>
        <table>
            <tr>
                <td>
                    <asp:Button ID="btnNew" runat="server" Text="New" Width="65px" OnClick="btnNew_Click" />
                    <asp:Button ID="btnAdd" runat="server" Text="Add" Width="65px" OnClick="btnAdd_Click"
                        ValidationGroup="Validate" />
                    <asp:Button ID="btnUpdate" runat="server" Text="Update" Width="65px" OnClick="btnUpdate_Click"
                        ValidationGroup="Validate" />
                    <asp:Button ID="btnDelete" runat="server" Text="Delete" Width="65px" OnClick="btnDelete_Click" />
                </td>
            </tr>
        </table>
    </div>
    <div>
        <table>
            <tr>
                <td>
                    <asp:TextBox ID="txtSearchName" runat="server" Width="111px"></asp:TextBox>
                    <asp:DropDownList ID="cbSearch" runat="server" Width="111px">
                        <asp:ListItem>Category Name</asp:ListItem>
                    </asp:DropDownList>
                    <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />
                    <asp:Button ID="btnReload" runat="server" Text="Reload" OnClick="btnReload_Click" />
                </td>
            </tr>
        </table>
    </div>
    <asp:GridView ID="gvCategories" runat="server" OnPageIndexChanging="gvCategories_PageIndexChanging"
        OnSelectedIndexChanged="gvCategories_SelectedIndexChanged" AutoGenerateColumns="False">
        <Columns>
            <asp:BoundField DataField="categoryid" HeaderText="Category ID" />
            <asp:BoundField DataField="categoryname" HeaderText="Category Name" />
            <asp:BoundField DataField="description" HeaderText="Description" />
        </Columns>
    </asp:GridView>
</asp:Content>
